// pages/center/center.js
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    shopName:'',
    shopAddress: '',
    pic: '',
    version: '',
    about: '',
    pic: '',
    shop_pic: '',
    baseimageurl: ''
  },


  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      pic: app.globalData.pic,
      shop_pic: app.globalData.shop_pic,
      baseimageurl: app.globalData.baseImageUrl
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    let that = this;
      that.setData({
        shopName: app.globalData.shopName,
        shopAddress: app.globalData.shopAddress,
        pic: app.globalData.pic,
        version: app.globalData.version,
        about: app.globalData.about
      })
    console.log(this.data)
  },
  qr:function(){
    wx.navigateTo({
      url: '../center/my-qrCode/my-qrCode',
    })
  },
  yj: function () {
    wx.navigateTo({
      url: '../center/my-charges/my-charges',
    })
  },
  aboutus: function () {
    wx.navigateTo({
      url: '../center/about/about',
    })
  },
  logout: function() {
    app.post('/shopuser/logout').then(res=>{
      wx.redirectTo({
        url: '../login/login',
      })
    });
  }
})
